package wfl.spec.edu;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

public class wechatAdapter3 extends RecyclerView.Adapter<wechatAdapter3.ViewHolder> {
    private List<wechat3>mWechat3List;

    static class ViewHolder extends RecyclerView.ViewHolder{
        ImageView wechat3Image;
        TextView wechat3Content;

        public ViewHolder(View view){
            super(view);
            wechat3Image=(ImageView) view.findViewById(R.id.wechat3_image);
            wechat3Content=(TextView) view.findViewById(R.id.wechat3_content);
        }
    }

    public wechatAdapter3(List<wechat3>wechat3List){
        mWechat3List=wechat3List;
    }

    public ViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
        View view=LayoutInflater.from(parent.getContext()).inflate(R.layout.wechat_item,parent,false);
        ViewHolder holder=new ViewHolder(view);
        return holder;
    }

    public void onBindViewHolder(ViewHolder holder,int position){
       wechat3 wechat3 =mWechat3List.get(position);
       holder.wechat3Image.setImageResource(wechat3.getImageId());
        holder.wechat3Content.setText(wechat3.getContent());
    }

    public int getItemCount(){
        return  mWechat3List.size();
    }
}
